# Maintainer: Bruno Pagani <archange@archlinux.org>

_pkg=MooX-HandlesVia
pkgname=perl-${_pkg,,}
pkgver=0.001009
pkgrel=4
pkgdesc="NativeTrait-like behavior for Moo"
arch=('any')
url="https://metacpan.org/release/${_pkg}"
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl-class-method-modifiers' 'perl-data-perl' 'perl-module-runtime' 'perl-moo' 'perl-role-tiny')
makedepends=('perl-moox-types-mooselike')
checkdepends=('perl-test-exception' 'perl-test-fatal' 'perl-test-simple')
source=("https://cpan.metacpan.org/authors/id/T/TO/TOBYINK/${_pkg}-${pkgver}.tar.gz")
sha512sums=('ea3521bf04c52db09068d4fa7cedd3642fd54fc40b5c88cde9340f0a3bb0da03f2aabbe22788a4f33ffedc628fc510c4fb57bdf3f7c9ce1b9316dd1408c2dd40')

build() {
    cd ${_pkg}-${pkgver}
    export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
    perl Makefile.PL
    make
}

check() {
    cd ${_pkg}-${pkgver}
    make test
}

package() {
    cd ${_pkg}-${pkgver}
    make INSTALLDIRS=vendor DESTDIR="$pkgdir" install
}
